package org.zffc.boot.starter.vault.domain;

import lombok.Data;

import java.security.Key;
import java.util.Base64;

/**
 * 密钥
 */
@Data
public class KeyPair {
    /**
     * 私钥 用来解密的的密钥
     */
    private String privateKey;
    /**
     * 公钥 用来加密的密钥
     */
    private String publicKey;

    public KeyPair(Key privateKey, Key publicKey) {
        this.privateKey = Base64.getEncoder().encodeToString(privateKey.getEncoded());
        this.publicKey = Base64.getEncoder().encodeToString(publicKey.getEncoded());
    }
}
